package com.weimob.mcloud.wechatwork.customer.check;

import com.weimob.mcloud.wechatwork.customer.service.user.exception.BizException;
import com.weimob.mcloud.wechatwork.customer.service.user.module.dto.tag.v2.CustomerCorpTagDTO;
import org.apache.commons.lang3.StringUtils;

import java.util.Objects;

import static com.weimob.mcloud.wechatwork.customer.service.user.enums.TagBizErrorEnum.*;

public class CustomerTagCheck {

    public static void checkAddUserTag(CustomerCorpTagDTO request) {
        if (StringUtils.isBlank(request.getCorpId())) {
            throw new BizException(Long.parseLong(CORP_ID_NOT_EXIT.getCode()), CORP_ID_NOT_EXIT.getDesc());
        }

        if (Objects.isNull(request.getBosId())) {
            throw new BizException(Long.parseLong(BO_ID_NOT_EXIT.getCode()), BO_ID_NOT_EXIT.getDesc());
        }
        if (Objects.isNull(request.getWid())) {
            throw new BizException(Long.parseLong(CUSTOMER_WID_IS_NOT_EMPTY.getCode()), CUSTOMER_WID_IS_NOT_EMPTY.getDesc());
        }
    }
}
